package com.lgx.mobile.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.lgx.common.exception.DataException;
import com.lgx.mobile.dao.IGiftRecordDao;
import com.lgx.mobile.entity.GiftRecord;
import com.lgx.mobile.service.IGiftRecordService;

/**
 * 礼物赠送记录Service
 * 
 * @author xuyichen
 *
 */
@Service("giftRecordService")
public class GiftRecordService implements IGiftRecordService {

	@Autowired
	private IGiftRecordDao giftRecordDao;

	public IGiftRecordDao getGiftRecordDao() {
		return giftRecordDao;
	}

	public void setGiftRecordDao(IGiftRecordDao giftRecordDao) {
		this.giftRecordDao = giftRecordDao;
	}

	@Transactional
	public GiftRecord createGiftRecord(GiftRecord giftRecord) throws DataException {
		return this.giftRecordDao.createGiftRecord(giftRecord);
	}

	@Transactional
	public GiftRecord updateGiftRecord(GiftRecord giftRecord) throws DataException {
		return this.giftRecordDao.updateGiftRecord(giftRecord);
	}

	@Transactional
	public void deleteGiftRecord(GiftRecord giftRecord) throws DataException {
		this.giftRecordDao.deleteGiftRecord(giftRecord);
	}

	@Transactional
	public void deleteGiftRecordById(long id) throws DataException {
		this.giftRecordDao.deleteGiftRecordById(id);
	}

	public GiftRecord findGiftRecordById(long id) {
		return this.giftRecordDao.findGiftRecordById(id);
	}

	public List<GiftRecord> findGiftRecordList() {
		return this.giftRecordDao.findGiftRecordList();
	}
}
